package com.yc.psychologicalconsultant.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @author YC
 * @version 1.0
 */
@Configuration
public class WebsocketConfig {
    //该Bean自动将@ServerEndpoint注解声明的类注册为Websocket的端点（即连接请求、消息发送、断开链接的实现类）
    //该Bean自动将@ServerEndpoint注解声明的类注册为Websocket容器中，
    // 使其响应客户端WebSocket连接请求并处理相关业务逻辑
    @Bean
    public ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }
}
